package cn.zust.edu.cn;

public class Triangle implements IShape{
    private Point ptA;
    private Point ptB;
    private Point ptC;
    private double edgeA;
    private double edgeB;
    private double edgeC;
    public double getEdgeA() {
        return edgeA;
    }

    public double getEdgeB() {
        return edgeB;
    }

    public double getEdgeC() {
        return edgeC;
    }

    public Point getPtA() {
        return ptA;
    }

    public void setPtA(Point ptA) {
        this.ptA = ptA;
    }

    public Point getPtB() {
        return ptB;
    }

    public void setPtB(Point ptB) {
        this.ptB = ptB;
    }

    public Point getPtC() {
        return ptC;
    }

    public void setPtC(Point ptC) {
        this.ptC = ptC;
    }

    public Triangle(Point ptA, Point ptB, Point ptC) {
        this.ptA = ptA;
        this.ptB = ptB;
        this.ptC = ptC;
    }

    public double perimeter() {
        return this.edgeA + this.edgeB + this.edgeC;
    }

    public double area() {
        double p = (this.edgeA + this.edgeB + this.edgeC) / 2.0D;
        return Math.sqrt(p * (p - this.edgeA) * (p - this.edgeB) * (p - this.edgeC));
    }

    public void draw() {
        System.out.println("Triangle...");
    }
}
